﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DP.Web.UI;
using CRM.Entity;
using CRM.BLL;

namespace CRM.Web.CallBackManage
{
    public partial class Modify : Common.PageBase
    {

        private const string frameHistoryInfo = "HistoryContact.aspx?CUSTOMERID={0}&TASKID={1}";
        private const string frameSurveyInfo = "../SurveyManage/SurveyShow.aspx?CUSTOMERID={0}&TASKID={1}&SURVEY_ID={2}";
        private const string frameCustomerInfo = "../CustomerManage/CustomerShow.aspx?CUSTOMERID={0}&TASKID={1}";
        private const string frameCallBackInfo = "CallBackHandle.aspx?CUSTOMERID={0}&TASKID={1}";

        T_CALLBACK_PLAN_BLL callBackPlanBll = new T_CALLBACK_PLAN_BLL();

        protected void Page_Load(object sender, EventArgs e)
        {
            string customerId = PageHelper.GetQueryString(this.Page, "CUSTOMERID");
            string taskId = PageHelper.GetQueryString(this.Page, "TASK_ID");
            string surveyId = "";

            T_CALLBACK_PLAN_Entity callBackPlanEntity = callBackPlanBll.GetEntity("TASK_ID", taskId);
            if (callBackPlanEntity != null)
            {
                surveyId = callBackPlanEntity.SURVEY_ID.ToString();
            }

            frameCustomer.Attributes["src"] = String.Format(frameCustomerInfo, customerId, taskId);
            frameSurvey.Attributes["src"] = String.Format(frameSurveyInfo, customerId, taskId, surveyId);
            frameHistory.Attributes["src"] = String.Format(frameHistoryInfo, customerId, taskId);
            frameCallBack.Attributes["src"] = String.Format(frameCallBackInfo, customerId, taskId);

        }
    }
}
